//
// Decompiled by Jadx - 382ms
//
package gc;

import android.text.TextUtils;
import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XposedHelpers;
import fn.j;
import fn.y;
import java.util.HashMap;
import java.util.List;
import java.util.Objects;
import me.plusne.NativeTools;
import me.plusne.common.Json.JsonHookStatic;
import r.g;

public final class ax extends XC_MethodHook {
    public final aw a;

    public ax(aw awVar) {
        this.a = awVar;
    }

    /* JADX WARN: Removed duplicated region for block: B:22:0x0104  */
    /* JADX WARN: Removed duplicated region for block: B:26:0x012a  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void afterHookedMethod(XC_MethodHook.MethodHookParam methodHookParam) throws Throwable {
        int i;
        int i2;
        String str;
        Object obj;
        Object obj2;
        super.afterHookedMethod(methodHookParam);
        JsonHookStatic jsonHookStatic = y.by;
        if (jsonHookStatic.getActivity().getClass().getName().equals("cn.soulapp.android.component.chat.ConversationActivity") && methodHookParam.getResult() != null) {
            List list = (List) methodHookParam.getResult();
            Object dr = z.dr(methodHookParam.args[2]);
            if (z.eg(dr)) {
                int intField = XposedHelpers.getIntField(dr, "msgType");
                aw awVar = this.a;
                if (intField == 1) {
                    i = 200;
                    i2 = -2113404820;
                    str = " 修改 ";
                } else {
                    if (intField == 2) {
                        list.add(aw.da(awVar, " 复制 ", 201, -2113404824));
                        obj = aw.da(awVar, " 打开 ", 202, -2113404809);
                        list.add(obj);
                        if (intField == 35) {
                        }
                        list.add(aw.da(awVar, "转发", 206, -2113404819));
                        if (NativeTools.n(JsonHookStatic.l, jsonHookStatic.getUserInfo())) {
                        }
                        methodHookParam.setResult(list);
                    }
                    str = " 下载 ";
                    if (intField == 5) {
                        list.add(aw.da(awVar, " 复制 ", 203, -2113404824));
                        list.add(aw.da(awVar, " 下载 ", 204, -2113404822));
                        i = 207;
                        i2 = -2113404803;
                        str = " 收藏 ";
                    } else {
                        if (intField != 8) {
                            if (intField != 35) {
                                j.bi(new Object[]{"菜单类型", Integer.valueOf(intField)});
                            } else if (y.ch("Code_ImgQuery2", false) && (obj2 = ((HashMap) XposedHelpers.getObjectField(dr, "maps")).get("MSGCONTENT")) != null && obj2.getClass().getName().equals("cn.soulapp.imlib.msg.chat.JsonMsg") && Objects.equals(j.as(obj2, "messageType"), "exchange_image")) {
                                i = 208;
                                i2 = -2113404815;
                                str = " 查看原图 ";
                            }
                            if (intField == 35 || NativeTools.n(JsonHookStatic.l, jsonHookStatic.getUserInfo())) {
                                list.add(aw.da(awVar, "转发", 206, -2113404819));
                            }
                            if (NativeTools.n(JsonHookStatic.l, jsonHookStatic.getUserInfo())) {
                                list.add(aw.da(awVar, "数据", 209, -2113404824));
                                if (intField == 1 && !TextUtils.isEmpty(g.u(z.dv(methodHookParam.args[2])))) {
                                    list.add(aw.da(awVar, "翻译", 210, -2113404817));
                                }
                            }
                            methodHookParam.setResult(list);
                        }
                        list.add(aw.da(awVar, " 复制 ", 201, -2113404824));
                        list.add(aw.da(awVar, " 打开 ", 202, -2113404809));
                        i = 205;
                        i2 = -2113404822;
                    }
                }
                obj = aw.da(awVar, str, i, i2);
                list.add(obj);
                if (intField == 35) {
                }
                list.add(aw.da(awVar, "转发", 206, -2113404819));
                if (NativeTools.n(JsonHookStatic.l, jsonHookStatic.getUserInfo())) {
                }
                methodHookParam.setResult(list);
            }
        }
    }
}
